using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PACKETPARSERMAX20.CORE;

namespace PACKETPARSERMAX20.CORE.DEFINITIONS
{
    public class SMSG_GROUP_LIST_DEF : DefinitionBase
    {

        public override bool Process()
        {
            return true;//IGNORED
            ResetPosition();

            byte m_groupType = ReadByte();                        // group type
            byte isBGGroup = ReadByte();              // 2.0.x, isBattleGroundGroup?
            byte group = ReadByte();                       // groupid
            byte mainassistant = ReadByte();            // 0x2 main assist, 0x4 main tank
            UInt64 voicechat = ReadUInt64();               // related to voice chat?
            UInt32 MembersCount = ReadUInt32();
            for (int i = 0; i < MembersCount; i++)
            {

                string name = ReadString();
                UInt64 guid = ReadUInt64();

                byte online = ReadByte(); // online-state
                byte groupid = ReadByte();                  // groupid
                byte assistant = ReadByte();      // 0x2 main assist, 0x4 main tank
            }

            UInt64 leaderGuid = ReadUInt64();                       // leader guid
            if (MembersCount > 0)
            {
                byte m_lootMethod = ReadByte();                    // loot method
                UInt64 looterGuid = ReadUInt64();                   // looter guid
                byte m_lootThreshold = ReadByte();                 // loot threshold
                byte m_difficulty = ReadByte();                    // Heroic Mod Group
            }


            return Validate();
        }



        //if (OpcodeEnum == Opcodes.SMSG_GROUP_LIST)
        //    {
        //        byte groupType = ReadByte();    // group type
        //        byte isBGGroup = ReadByte();    // 2.0.x, isBattleGroundGroup?
        //        byte groupid = ReadByte();      // groupid
        //        byte flags = ReadByte();        // 2.1.0 unk, member flags?
        //        UInt64 guid = ReadUInt64();       // 2.1.0 unk const. guid?       
        //        UInt32 members = ReadUInt32();

        //        for (uint i = 0; i < members; i++)
        //        {

        //            string member_name = ReadString();
        //            UInt64 member_guid = ReadUInt64();
        //            byte mebmer_online = ReadByte();
        //            byte member_groupid = ReadByte();
        //            byte member_flags = ReadByte();
        //        }

        //        UInt64 leader_guid = ReadUInt64();                    // leader guid
        //        byte lootmethod = ReadByte();                       // loot method
        //        UInt64 looter_guid = ReadUInt64();                    // looter guid
        //        byte lootThreshold = ReadByte();                    // loot threshold
        //        byte unk = ReadByte();                    // 2.1.0 unk

        //        return true;
        //    }
    }
}

